﻿using FluentNHibernate.Mapping;
using Utility.Global.DataTypes;

namespace Application_Core.Arbeitsplan_Component.Data_Access_Layer
{
    public class VorgangMap : ClassMap<Vorgang>
    {
        public VorgangMap()
        {
            Id(x => x.Id)
                .GeneratedBy.Identity()
                .Length(11);
            Map(x => x.Art)
                .Nullable()
                .CustomType<int>();
            Map(x => x.Rüstzeit)
                .Not.Nullable();
            Map(x => x.Maschinenzeit)
                .Not.Nullable();
            Map(x => x.Personenzeit)
                .Not.Nullable();
            References(x => x.Arbeitsplan)
                .Not.Nullable()
                .Cascade.All()
                .Not.LazyLoad();
        }
    }
}
